﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Manage_artist_Default : System.Web.UI.Page
{
    private BLL.Artist artist;

    private int COUNT;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            initData();
        }
    }
    public void initData()
    {
        artist = new BLL.Artist();
        DataView dv = artist.FindAll(Convert.ToInt32(J.Comm.Url.Output(Request["nKey"]))).Tables[0].DefaultView;

        COUNT = dv.Table.Rows.Count;
        AspNetPager1.RecordCount = COUNT;
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dv;
        pds.AllowPaging = true;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        Repeater1.DataSource = pds;
        Repeater1.DataBind();
        if (pds.Count > 0)
        {
            AspNetPager1.Visible = true;
        }
        else
        {
            AspNetPager1.Visible = false;
        }
    }
    protected int PageCount
    {
        get { return COUNT; }
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        initData();
    }
}
